Skip to main content
Feedback

Segments, loops, and data elements

Updated 

An EDI document is a series of rows, called segments. Each segment contains data elements. Segments are grouped into loops, which can repeat within the document.

The meaning of each segment and its data comes from a specification, usually supplied by the trading partner. You can change or add segments and data elements to match the specification. For a User Defined profile, you define all of the segments and data elements yourself from your own specification.

Loops and sections

Segments are grouped into header, detail, and summary sections. For example, a purchase order might contain these:

  • Header: buyer and seller information, shipping addresses, requested delivery dates, and special instructions.
  • Detail: product orders, quantities, packaging, and pricing.
  • Summary: total charges, total weight, and total number of pieces.

Segment order

The order of segments matters. The order in your profile must match the order in the source document. The same segment name can appear in both the header and detail sections, such as the N9 segment in many X12 transaction sets. If the segments are out of order, a map can associate a segment with the wrong loop.

Data elements, composites, and sub-composites

A data element can have one or more components, called composites. A composite can have one or more sub-components, called sub-composites. You can display and map composites and sub-composites. A composite or sub-composite can have a different data type from its parent element.

Names follow a pattern. A composite name is the data element name, a period, and the composite number. A sub-composite name adds another period and the sub-composite number. For example, in the HL7 data element PV107, the first composite is PV107.1, and the first sub-composite of the second composite is PV107.2.1.

Composite display depends on the standard and on the Enhanced Composites option. For more information, refer to Displaying composite or sub-composite elements and Using enhanced composites.

On this Page